<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>table-xlsx</title>
    <!-- 注意: 部署时，将 "development.umd.js" 替换为 "production.umd.js"-->
    <script src="https://unpkg.com/table-xlsx/dist/table-xlsx.development.umd.js" crossorigin></script>
</head>
<body>
<script>
  function onExportClick() {
    const dataSource = [
      {key: '1', name: '胡彦斌', age: 32, address: '西湖区湖底公园1号',},
      {key: '2', name: '胡彦祖', age: 42, address: '西湖区湖底公园1号',},
    ];

    const columns = [
      {title: '姓名', dataIndex: 'name', key: 'name',},
      {title: '年龄', dataIndex: 'age', key: 'age',},
      {title: '住址', dataIndex: 'address', key: 'address',},
    ];

    exportFile({
      columns: columns,
      dataSource: dataSource,
    });
  }
</script>
<button onclick="onExportClick()">导出</button>
</body>
</html>
